﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dijiang.Values
{
    public class DRef : DValue
    {
        public object? reference;

        public DRef(object? reference)
        {
            this.reference = reference;
        }

        public DValue Copy()
        {
            return this;
        }

        public bool Equals(DValue? other)
        {
            return other is DRef ro && reference == ro.reference;
        }

        public DValue Eval(CmdEnv env)
        {
            return this;
        }

        public override string ToString()
        {
            return $"<Ref,{reference ?? "null"}>";
        }
    }
}
